import React from "react";
import {useNavigate} from 'react-router-dom'
import { Cell, Button,Toast } from 'react-vant';
import "./index.css";
const Index:React.FC = () => {
  const navigate=useNavigate()
  const tu=()=>{
    Toast.success("退出成功");
    localStorage.removeItem("token");
    localStorage.removeItem("user");
    localStorage.removeItem("info");
    localStorage.removeItem("row");
    navigate("/login");
  }
  const dz=()=>{
    navigate("/address")
  }
  return (
    <div>
      <div className="tx">
        <img src={localStorage.getItem('info')!}/>
      </div>
      <Cell title="用户名" value={localStorage.getItem("user")} />
       <Cell title="地址" value={localStorage.getItem("address")} onClick={()=>dz()} />
      <div className="tc"><Button type='danger' onClick={()=>tu()}>退出登录</Button></div>
    </div>
  );
};
export default Index;
